//
//  LTFExclusiveModel.m
//  NeteaseNews
//
//  Created by liutaifeng on 16/4/26.
//  Copyright © 2016年 liutaifeng. All rights reserved.
//

#import "LTFExclusiveModel.h"

@implementation LTFExclusiveModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"ads"]) {
        NSArray *adArray = (NSArray *)value;
        NSMutableArray *tempArray = [NSMutableArray array];
        for (NSDictionary *dic in adArray) {
            LTFExclusiveModel *model = [LTFExclusiveModel new];
            [model setValuesForKeysWithDictionary:dic];
            [tempArray addObject:model];
        }
        _ads = [[NSArray arrayWithArray:tempArray] retain];
    }
    else {
        if ([key isEqualToString:@"res_url"]) {
            _ads = value;
        }
        if ([key isEqualToString:@"main_title"]) {
            _title = value;
        }
        [super setValue:value forUndefinedKey:key];
    }
}
@end
